﻿function getSelectCheckBoxVals(single,prefixCk){
	prefixCk = prefixCk || 'ck_';
	var $selectElm = $("input[id^='"+prefixCk+"']:checked");
    if($selectElm.length == 0){
	   alert('请至少选择一条记录');
	   return "";
	}
    
    if(single == true){
    	if($selectElm.length > 1){
    		   alert('当前只允许选择一条记录');
    		   return "";
    	}
    }
	var selectVals = "";
	$selectElm.each(function(index){
	    selectVals = selectVals +(index==0?"":":") + $(this).val();
	});
	return selectVals;
}



function redirectTo(url){
	window.location.href = url;
}

/* 错误提示 */
function checkError(data) {
	var title = "Warn Message";
	try {
		var json;
		var text = data.responseText;
		if (!text) {
			json = data;
		} else {
			json = eval("(" + text + ")");
		}

		if (json.actionError) {
			var content = json.actionError;
			alert(content);
			return true;
		}
		return false;
	} catch (e) {
		alert("JS错误："+e);
		return true;
	}
}